Skip to content

docs: the project structure lists folders and DESIGN.md keeps a card per component, with details beside the code - #2177

Merged
yw0nam merged 8 commits into
mainfrom
docs/2176-structure-and-design
Nov 29, 2026
Merged

yw0nam merged 8 commits into
mainfrom
docs/2176-structure-and-design

Conversation

@yw0nam

@yw0nam yw0nam commented Nov 29, 2026

Copy link
Copy Markdown
Owner

Summary

Two foundation documents shrink to what stays true when code moves, and the detail goes beside the code. No behaviour changes.

docs/agent-guide/project-structure.md   1,175 lines -> 312   folders only; a file's description is its first-line comment
DESIGN.md                               14,496 words -> 4,309 principles, tokens, rules, and one summary card per component
docs/agent-guide/design/<component>.md  21 new files         each component's specification, moved byte for byte
src/, src-tauri/src/, plugins/*/src/    186 files            one first-line comment each, nothing else
  • File descriptions. 186 source files had no first-line comment. 152 take the line project-structure.md held for them, unchanged; 34 had no line and get one sentence written from the file. Every non-test .ts, .tsx, .css and .rs source file now opens with its description.
  • project-structure.md. The Stack table stays. The map keeps every folder (26 bare lines got a description, 17 source folders that had no line got one) and the files that cannot hold a comment (the HTML entries, the JSON under configs/). No existing folder description was reworded.
  • DESIGN.md. Sections 1 to 4, section 6, the frontmatter and every Named Rules block are byte-identical. In section 5 each component keeps a card: its heading, the opening sentence of its specification, a Spec link and its Surface folder. A tool that reads DESIGN.md by ### section still finds 22 entries (checked with the design parser the design-review skill uses).
  • A test keeps the cards honest. A card's paragraph is a copy of its specification's opening, so src/ui/tokens.test.ts fails when a card drifts from its file, when a Spec link or Surface folder stops existing, when headings differ, when a file has no card, or when a card has no paragraph.
  • Pointers. AGENTS.md, docs/agent-guide/design-context.md and CONTRIBUTING.md say what to read: DESIGN.md always, a component file when its surface is touched. CONTRIBUTING.md § Review checklist gains one item: pnpm map:check checks paths and shape, so a review greps map.js for what the diff moved.

Proof that source changed by first-line comments only (test file aside):

  • git diff main --numstat -- src src-tauri plugins vite.config.ts ':!src/ui/tokens.test.ts' | awk '$1!=1 || $2!=0' prints nothing: 186 files, one added line each.
  • git diff -U0 main -- src src-tauri plugins vite.config.ts ':!src/ui/tokens.test.ts' | grep '^@@' | grep -v -E '^@@ -0,0 \+1 @@$' prints nothing: every hunk is an insertion at line 1.
  • Each of the 21 component files equals its section of main:DESIGN.md except the heading line, and one cross-reference in speech-bubble.md that said "see Trigger line below" and now names trigger-line.md.

Related issues

Closes #2176

Related decisions / docs

  • Owner, 2026-11-29: project-structure.md goes to folder level; DESIGN.md keeps principles and a summary card per component; the architecture map keeps its structure and the review checklist gains one line.
  • Touched docs: docs/agent-guide/project-structure.md, DESIGN.md, docs/agent-guide/design/*.md, docs/agent-guide/design-context.md, AGENTS.md, CONTRIBUTING.md.
  • Independent review (single reviewer, two rounds): all 34 hand-written comments opened and judged, 25 of the 152 moved ones sampled against their files, all 43 new folder descriptions judged against the folders, the three proofs re-run, the card test mutated six ways. Its findings are fixed in the last two commits (two Surface folders, two folder lines, two comments, one cross-reference, the empty-paragraph case). Left as is by decision: a comment in src/ui/surfaces/surfaces.css that says a rule is "permitted by DESIGN.md" (the card there leads to the rule), and the card test's place in tokens.test.ts.

Runtime evidence (required for UI / DOM / runtime behavior)

N/A: no runtime behavior change. Comments and documents only.

Merge danger

Door: two-way (a revert restores both documents). Blast radius: none at runtime. #2173's branch edits project-structure.md; it takes this structure when it merges main.

Verification

  • pnpm build passes (includes tsc typecheck)
  • pnpm test passes
  • pnpm lint passes (biome format + lint)
  • cargo test / cargo clippy pass (Rust changes)
  • Runtime evidence N/A justified

TEST_GUARD_SKIP=1 pnpm gates exits 0 with all 18 gates at d375842; the commit after it adds one assertion, checked with vitest run src/ui/tokens.test.ts (9 passed), biome check and pnpm typecheck:test.

Checklist (YUI principles)

  • Schema changes update docs/reference/client-context.md alongside the code: none
  • docs/agent-guide/architecture/map.js: none changed
  • No unverified assumptions (docs first; web/context7 cross-check)
  • No brain in the client
  • No inline control tags
  • No hardcoding
  • skip-tests label justified: 186 comment-only source lines count as source change for test-guard; the only behaviour under test is the card check, which ships its test

@yw0nam yw0nam added the skip-tests test-guard bypass: justified change with no test (rename/config/generated) label Nov 29, 2026
@yw0nam
yw0nam marked this pull request as ready for review November 29, 2026 14:24
@yw0nam
yw0nam merged commit 16e0cb3 into main Nov 29, 2026
12 checks passed
@yw0nam
yw0nam deleted the docs/2176-structure-and-design branch November 29, 2026 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-tests test-guard bypass: justified change with no test (rename/config/generated)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature] The project structure and design documents shrink to what stays true: folders and principles, with details beside the code

1 participant